<!doctype html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
>
<head>
    <th:block th:include="common/head::noXadmin('查看资源')"/>
</head>
<body class="layui-layout layui-layout-admin">
<div class="layui-container">
    <form class="layui-form ">
        <input type="hidden" name="deptId" th:value="${dept?.deptId}"/>
        <fieldset class="layui-elem-field layui-field-title">
            <legend>基本信息</legend>
        </fieldset>
        <div class="layui-row layui-col-space30 " style="margin: 0px 30px 0px 30px ">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">上级部门</label>
                    <div class="layui-input-block">
                        <input type="hidden" id="parentId" name="parentId" th:value="${dept?.parentId}" readonly>
                        <input type="text" id="parentName" placeholder="上级部门" class="layui-input"
                               th:value="${parent?.deptName}" lay-verify="required" readonly="readonly"
                               onclick="loadTree()">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label is-required">部门名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="deptName" autocomplete="off" placeholder="请输入部门名称" class="layui-input"
                               required lay-verify="required" th:value="${dept?.deptName}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label ">显示排序</label>
                    <div class="layui-input-block">
                        <input type="number" name="orderNo" value="0" placeholder="排序" autocomplete="off"
                               class="layui-input" lay-verify="number" th:value="${dept?.orderNo}">
                    </div>
                </div>
                <div class="layui-form-item" pane="">
                    <label class="layui-form-label">部门状态</label>
                    <div class="layui-input-block">
                        <input type="hidden" name="status" id="status" th:value="${dept?.status}">
                        <input type="checkbox" lay-skin="switch" lay-filter="status"
                               lay-text="正常|停用" value="0" th:checked="${dept?.status eq 0}">
                    </div>
                </div>

            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title">
            <legend>其他信息</legend>
        </fieldset>
        <div class="layui-row" style="margin: 0px 30px 0px 30px ">
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入内容" class="layui-textarea" name="remark"
                              th:text="${dept?.remark}"></textarea>
                </div>
            </div>
        </div>

    </form>

</div>
<script>
    layui.use(['form', 'jquery'], function () {
        var form = layui.form
            , $ = layui.jquery
        ;
        $("input").attr("disabled", "disabled")
        $("textarea").attr("disabled", "disabled")
        $("select").attr("disabled", "disabled")
        form.render();
    })
</script>

</body>

</html>
